<button class="btn btn-info" type="button" onclick="backtoMain()">返回</button><br>
<ul class="nav nav-tabs">
    <li role="presentation"><a href="javascript:;" onclick="toInReport()">收入</a></li>
    <li role="presentation" class="active"><a href="javascript:;">支出</a></li>
</ul>
<table class="table" id="pomainDiv">
    <thead>
    <tr>
        <th>销售单编号</th>
        <th>收款日期</th>
        <th>收款金额</th>
        <th>经手人</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody id="tableBody"></tbody>
</table>


<script id="RandEItemReportTemplate" type="text/html">
    {{each data value index}}
    <tr>
        <td>{{value.orderCode}}</td>
        <td>{{value.pay_Time}}</td>
        <td>{{value.pay_price}}</td>
        <td>{{value.account}}</td>
        <td><input type="button" value="查看采购明细" onclick="topomain('{{value.orderCode}}')"></td>
    </tr>
    {{/each}}
</script>

<script>
    $(function () {
        Ajax.post(
            "/selectRandEForE",
            {date:sessionStorage.getItem("RandEdate")},
            function (result) {
                var div=document.getElementById("tableBody")
                var html=template('RandEForEItemReportTemplate',{data:result.data})
                div.innerHTML=html
            }
        )
    })
    function backtoMain() {
        sessionStorage.setItem("backRandEdate",sessionStorage.getItem("RandEdate"))
        show("/report/RandEReport.html")
    }
    function topomain(obj) {
        window.sessionStorage.setItem("poId",obj)
        show("/report/reportPomainSearch.html")
    }
    function toInReport() {
        show("/report/RandEItemReport.html")
    }
</script>
